package oaSystem.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import oaSystem.entity.Announcement;

public interface AnnouncementMapper {
	void addAnnouncement(Announcement announcement);//添加
	void updateAnnouncement(Announcement announcement);//修改
	List<Announcement> findAllAnnouncement();//查看所有
	List<Announcement> findAnnouncementByDepartmentId(int departmentId);//查看关于部门的公告
	List<Announcement> findAnnouncementByCreator(@Param("creatorId") int creatorId,
			@Param("status") int status,
			@Param("keyword") String keyword,
			@Param("skips") int skips,
			@Param("takes") int takes);//申请人查看自己   不同状态的公告
	Integer findCountByCreator(@Param("creatorId") int creatorId,
			@Param("status") int status,
			@Param("keyword") String keyword);
	Announcement fetchAnnouncementById(int announcementId);//查单个公告
	List<Announcement> findAnnouncementByPending(@Param("departmentId") Integer departmentId, 
			@Param("status") Integer status,
			@Param("skips") int skips,
			@Param("takes") int takes);
	Integer findCountByPending(@Param("departmentId")int departmentId,@Param("status") int status);
}